package com.mingqijia.gassafety.shared.handler;

import cn.hutool.core.bean.BeanUtil;
import com.gap.basic.base.CommonResponse;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author Damon S.
 * @version v0.2
 * @date {YEAR}年{MONTH}月{DAY}日 {TIME}
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ResponseWrapper<T> extends CommonResponse<T> {
    private String token;

    public static ResponseWrapper wrap(Object resp) {
        ResponseWrapper wrapper = new ResponseWrapper();
        BeanUtil.copyProperties(resp, wrapper, true);
        return wrapper;
    }
}